<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ModifyLogisticsNumberFieldToOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('orders', function (Blueprint $blueprint) {
            $blueprint->integer('logistics_receipts')->unsigned()->nullable()->comment('物流单据，对应 attachment_private_files 表')->index()->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('orders', function (Blueprint $blueprint) {
            $blueprint->dropIndex('orders_logistics_receipts_index');

            $blueprint->string('logistics_receipts')->comment('物流单据')->change();
        });
    }
}
